﻿using Core.Configuration.Helper;
using Microsoft.AspNetCore.Mvc.Filters;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Configuration.Startup
{
    /// <summary>
    /// 全局Action控制器
    /// </summary>
    public class GlobalActionFilter : Attribute, IAsyncActionFilter
    {

        public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
        {
            //请求参数
            var param = context.HttpContext.Request.QueryString.Value;
            var controllerName = context.ActionDescriptor.RouteValues["controller"];
            var actionName = context.ActionDescriptor.RouteValues["action"];
        
            await next();
            
            //var excute = await next.Invoke(); // 这句话就是去执行Action

            
        }
    }
}